home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
SAT 2.3.8
/
Demos
/
StepPlatform Demo ƒ
/
myPlatform.h
< prev
next >
Wrap
Text File
|
1996-05-11
|
3KB
|
103 lines
/************************************************
* Nissan Zafrir Definations and Types *
************************************************/
#define MaxV(me) (*(MovPlatP)me->appPtr).MaxV
#define MinV(me) (*(MovPlatP)me->appPtr).MinV
#define MaxH(me) (*(MovPlatP)me->appPtr).MaxH
#define MinH(me) (*(MovPlatP)me->appPtr).MinH
typedef struct {
short MaxV,MinV;
short MaxH,MinH;
short filled; //unused
} MovPlatRec,*MovPlatP;
/** Actions **/
enum { ActionMsgNumber = 5};
#define Stand 0 //id=128
#define StandOnHMovPlatform 1 //id=129 the player stands on HMov so he gets his speedH
#define Jump 2 //id=130
#define JumpFromHMov 3 //id=131 jump from HMov Platform
#define Fall 4 //id=132
/** JumpKey **/
#define Pushed 1
#define NotPushed 0
/* Modified sprite struct. */
typedef struct PlSprite {
/* Variables that you should change as appropriate */
short kind;
Point position;
Rect hotRect, hotRect2; // Only change hotRect, SAT handles hotRect2
FacePtr face;
pascal void (*task) (struct Sprite *);
pascal void (*hitTask) (struct Sprite *, struct Sprite *);
pascal void (*destructTask) (struct Sprite *);
RgnHandle clip; /* Clip region to be used when this sprite is drawn. */
/* SAT variables that you shouldn't change: */
Point oldpos;
struct Sprite *next, *prev;
Rect r, oldr;
FacePtr oldFace; //Used by RunSAT2
Boolean dirty; //Used by RunSAT2
/* Variables for free use by the application: */
short layer;
Point speed;
short mode;
Point WorldPosition;
short action; // if its a jump,standing,running,or falling
short JumpKey; //released or not
Ptr appPtr;
long appLong;
} PlSprite, *PlSpritePtr;
// Routines
/* PlayerSprite's interface */
void InitPlayerSprite();
pascal void SetupPlayerSprite (PlSpritePtr);
pascal void HandlePlayerSprite (PlSpritePtr);
pascal void HitPlayerSprite (SpritePtr, SpritePtr);
/* PlatformSprite's interface */
void InitEmptyPlatform();
pascal void SetupEmptyPlatform (SpritePtr);
pascal void HandleEmptyPlatform (SpritePtr);
pascal void HitEmptyPlatform (SpritePtr, PlSpritePtr);
/* PlatformSprite's interface */
void InitPlatform();
pascal void SetupPlatform (SpritePtr);
pascal void HandlePlatform (SpritePtr);
pascal void HitPlatform (SpritePtr, PlSpritePtr);
/* PlatformMovSprite's interface */
void InitMovPlatform();
pascal void SetupMovPlatform(SpritePtr);
pascal void HandleMovPlatform(SpritePtr);
pascal void HitMovPlatform(SpritePtr, PlSpritePtr);
/* PlatformHMovSprite's interface */
void InitHMovPlatform();
pascal void SetupHMovPlatform(SpritePtr);
pascal void HandleHMovPlatform(SpritePtr);
pascal void HitHMovPlatform(SpritePtr, PlSpritePtr);
void InitInformationArea(void);
void DrawProgInfo(SpritePtr me);
void UpdateInfo(PlSpritePtr me);
void DrawProgrammerInfo(void);
Boolean IsPressed(unsigned short k);
Boolean IsOptionPressed(void);
/* prototype for the VBL procs */
Boolean InstallVBLCounter(void);
Boolean RemoveVBLCounter(void);
pascal int VBLCounterProc(void);